import numpy as np

# arr1 = np.array([3, 10, 8, 7, 34, 11, 28, 72])
# arr2 = np.array(((8.5, 6, 4.1, 2, 0.7), (1.5, 3, 5.4, 7.3, 9), (3.2, 3, 3.8, 3, 3), (11.2, 13.4, 15.6, 17.8, 19)))
# print('一维数组: \n', arr1)
# print('二维数组: \n', arr2)
#
# print(arr1[[2, 3, 5, 7]])
#
# print(arr2[1, 2])
#
# print(arr2[np.ix_([0, -1], [1, 3])])
# print(arr2[np.ix_([0, -1], [1, 2, 3])])


# stu_score = np.genfromtxt(fname='../DataSource/stu_score.txt', delimiter='\t', skip_header=1)
#
# print(type(stu_score))
# print(stu_score.ndim)
# print(stu_score.shape)
# print(stu_score.dtype)
# print(stu_score.size)

arr3 = np.array([[1, 5, 7], [3, 6, 1], [2, 4, 8], [5, 8, 9], [1, 5, 9], [8, 5, 2]])
print(arr3.shape)
print(arr3.reshape(2, 9))
print(arr3.shape)

print(arr3.resize(2, 9))
print(arr3.shape)
